package com.songcha.module_mine.ui.activity.message

import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter
import com.songcha.library_base.base.BaseActivity
import com.songcha.library_base.mvvm.base.BaseMvvmActivity
import com.songcha.library_business.config.FunctionConfig
import com.songcha.module_mine.R
import com.songcha.module_mine.databinding.MineActivityMessageBinding
import com.songcha.module_mine.ui.adapter.MessageAdapter

class MessageActivity:BaseMvvmActivity<MessageViewModel,MineActivityMessageBinding>() {
    private var mFragmentTitles = mutableListOf("消息通知","我的书评")

    override fun getLayoutId(): Int {
        return R.layout.mine_activity_message
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        if(!FunctionConfig.IS_BOOK_COMMENT_ENABLED){
            mFragmentTitles.removeLast()
        }
        val vp=databinding.mineMsgVp
        vp.adapter=MessageAdapter(supportFragmentManager,mFragmentTitles)
        databinding.mineMsgCtl.setViewPager(vp)
    }
}